// Package sysin
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2024 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.13.1
package sysin

import (
	"context"
	"hotgo/internal/model/entity"
	"hotgo/internal/model/input/form"

	"github.com/gogf/gf/v2/frame/g"
)

// StockRankUpdateFields 修改人气榜字段过滤
type StockRankUpdateFields struct {
	Code   string `json:"code"   dc:"code"`
	Name   string `json:"name"   dc:"name"`
	Desc   string `json:"desc"   dc:"解读"`
	Rank   int    `json:"rank"   dc:"排名"`
	Source string `json:"source" dc:"来源，开盘啦，东财，百度"`
}

// StockRankInsertFields 新增人气榜字段过滤
type StockRankInsertFields struct {
	Code   string `json:"code"   dc:"code"`
	Name   string `json:"name"   dc:"name"`
	Desc   string `json:"desc"   dc:"解读"`
	Rank   int    `json:"rank"   dc:"排名"`
	Source string `json:"source" dc:"来源，开盘啦，东财，百度"`
}

// StockRankEditInp 修改/新增人气榜
type StockRankEditInp struct {
	entity.StockRank
}

func (in *StockRankEditInp) Filter(ctx context.Context) (err error) {
	// 验证code
	if err := g.Validator().Rules("required").Data(in.Code).Messages("code不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	return
}

type StockRankEditModel struct{}

// StockRankDeleteInp 删除人气榜
type StockRankDeleteInp struct {
	Id interface{} `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *StockRankDeleteInp) Filter(ctx context.Context) (err error) {
	return
}

type StockRankDeleteModel struct{}

// StockRankViewInp 获取指定人气榜信息
type StockRankViewInp struct {
	Id int `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *StockRankViewInp) Filter(ctx context.Context) (err error) {
	return
}

type StockRankViewModel struct {
	entity.StockRank
}

// StockRankListInp 获取人气榜列表
type StockRankListInp struct {
	form.PageReq
	Id                          int     `json:"id"                          dc:"id"`
	StockZhASpotEmName          string  `json:"stockZhASpotEmName"          dc:""`
	StockZhASpotEmLastPrice     float64 `json:"stockZhASpotEmLastPrice"     dc:""`
	StockZhASpotEmChangePercent float64 `json:"stockZhASpotEmChangePercent" dc:""`
	StockZhASpotEmChangeAmount  float64 `json:"stockZhASpotEmChangeAmount"  dc:""`
}

func (in *StockRankListInp) Filter(ctx context.Context) (err error) {
	return
}

type StockRankListModel struct {
	Id                          int     `json:"id"                          dc:"id"`
	Code                        string  `json:"code"                        dc:"code"`
	Name                        string  `json:"name"                        dc:"name"`
	Desc                        string  `json:"desc"                        dc:"解读"`
	Rank                        int     `json:"rank"                        dc:"排名"`
	Source                      string  `json:"source"                      dc:"来源，开盘啦，东财，百度"`
	StockZhASpotEmName          string  `json:"stockZhASpotEmName"          dc:""`
	StockZhASpotEmLastPrice     float64 `json:"stockZhASpotEmLastPrice"     dc:""`
	StockZhASpotEmChangePercent float64 `json:"stockZhASpotEmChangePercent" dc:""`
	StockZhASpotEmChangeAmount  float64 `json:"stockZhASpotEmChangeAmount"  dc:""`
}

// StockRankExportModel 导出人气榜
type StockRankExportModel struct {
	Id     int    `json:"id"     dc:"id"`
	Code   string `json:"code"   dc:"code"`
	Name   string `json:"name"   dc:"name"`
	Desc   string `json:"desc"   dc:"解读"`
	Rank   int    `json:"rank"   dc:"排名"`
	Source string `json:"source" dc:"来源，开盘啦，东财，百度"`
}
